package com.syq.aop;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.aspectj.lang.annotation.Aspect;

/**
 * @ClassName: MyMethodIntercreptor
 * @Description: TODO
 * @Create by: syq
 * @Date: 8/7/2022 上午9:48
 */

@Aspect
public class MyMethodInterceptor implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        System.out.println("删除前");
        //回到方法中
        Object result = invocation.proceed();
        System.out.println(result);
        //回到方法中
        invocation.proceed();
        //结束
        System.out.println("结束");
        return null;
    }
}
